{% extends "site_base.html" %}

{% load i18n %}
{% load pagination_tags %}

{% block head_title %}{% endblock %}

{% block body_class %}
	{% if articles %}
		medee
	{% else %}
		{% if universities %}
			notices
		{% else %}
			{% if institutions %}
				stuw
			{% else %}
				{% if files %}
					file
				{% endif %}
			{% endif %}
		{% endif %}
	{% endif %}
{% endblock %}


{% block subnav %}
	{% if universities %}
    	<ul id="submenu" class="none">
        	<a href="/university/1">{% trans "АНУ, КАНАД" %}</a>
        	<a href="/university/2">{% trans "ИХ БРИТАНИ, АВСТРАЛИ" %}</a>
        	<a href="/university/3">{% trans "ЕВРОП " %}</a>
        	<a href="/university/4">{% trans "AЗИ " %}</a>
    	</ul>
    {% else %}
    	{% if articles %}
    		<br />
    	{% else %}
    		{% if institutions %}
    			<br />
    			{% else %}
    				{% if files %}
    				<br />
    				{% endif %}
    		{% endif %}
    	{% endif %}
    {% endif %}
{% endblock %} 


{% block body %}
	{% if articles %}
		{% if banner_right_long %}
			<div id="del_banner" style="margin-right:5px;">
	 			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
				  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
				  id="name" width="160" height="600">
				  <param name="movie" value="../../site_media/media/{{banner_right_long}}">
				  <param name="quality" value="high">
				  <param name="wmode" value="transparent">
				  <embed name="name" src="../../site_media/media/{{banner_right_long}}"
					  quality="high" wmode="transparent" width="160" height="600"
					  type="application/x-shockwave-flash" 
					  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
					  P1_Prod_Version=ShockwaveFlash">
				  </embed>
				</object>
			</div>
		{% endif %}
	{% endif %}

	{% if articles %}
		{% autopaginate articles 15 %}
		{% for article in articles %}
			<div id= "medee_content">
				<ul>
		        	<li>
		            	<div class="blockes">
		                	<h4><a href="/articles/{{article.id}}">{{article.header}}</a></h4>
		                	<p>{{article.content|truncatewords:40|safe}}</p>
		                	<small>Уншсан тоо: {{ article.read_count }} | Сэтгэгдлийн тоо: {{ article.comment_count }} | 
		                		{{ article.pub_date }} | <a class="del_news_medee" href="/articles/{{article.id}}">Дэлгэрэнгүй </a></small>
		                	<br />
		                </div>
		        	</li>
		        </ul>
			</div>
		{% endfor %}
		{% paginate %}
	{% endif %}
	
	{% if universities %}
		<div id ="universitie_aguulah">
			<div id = "universitie_category">
				<h3>{{category}}</h3>
			</div>
			<div id = "universitie_bannercon">
				<br />
				{% if banner_top %}
					<div id="ihsurguuli_bann">
			 			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
						  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
						  id="name" width="728" height="90">
						  <param name="movie" value="../../site_media/media/{{banner_top}}">
						  <param name="quality" value="high">
						  <param name="wmode" value="transparent">
						  <embed name="name" src="../../site_media/media/{{banner_top}}"
							  quality="high" wmode="transparent" width="728" height="90"
							  type="application/x-shockwave-flash" 
							  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
							  P1_Prod_Version=ShockwaveFlash">
						  </embed>
						</object>
					</div>
				{% endif %}
		    </div>
		   
		    <div id="universitie_container">
		    	{% autopaginate universities 12 %}
				{% for university in universities %}
					<div class="grid">
						<center>
							<div class="title_of_grid">
								<h6>{{university.uni_name}}</h6>
							</div>
							<div class="grid_img">
								<a href="/universities/{{university.id}}"><img src="../../site_media/media/{{university.uni_image}}"  width="180" height="150"/></a>
							</div>
							<p><a class="del_news" href="/universities/{{university.id}}">Дэлгэрэнгүй</a></p>
						</center>
					</div>
				{% endfor %}
				{% paginate %}
				<br/>
			</div>
		    {% if banner_bottom %}
				<div id = "universitie_bann_dood">
					<div id = "ihsurguuli_bann_zuun">
						<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
						  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
						  id="name" width="728" height="90">
						  <param name="movie" value="../../site_media/media/{{banner_bottom}}">
						  <param name="quality" value="high">
						  <param name="wmode" value="transparent">
						  <embed name="name" src="../../site_media/media/{{banner_bottom}}"
							  quality="high" wmode="transparent" width="728" height="90"
							  type="application/x-shockwave-flash" 
							  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
							  P1_Prod_Version=ShockwaveFlash">
						  </embed>
						</object>
					</div>
			    </div>
		    {% endif %}
		   	</div>
		{% endif %}
			
		{% if institutions %}
  			{% if banner_top %}
				<div id="ihsurguuli_bann">
		 			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
					  id="name" width="728" height="90">
					  <param name="movie" value="../../site_media/media/{{banner_top}}">
					  <param name="quality" value="high">
					  <param name="wmode" value="transparent">
					  <embed name="name" src="../../site_media/media/{{banner_top}}"
						  quality="high" wmode="transparent" width="728" height="90"
						  type="application/x-shockwave-flash" 
						  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
						  P1_Prod_Version=ShockwaveFlash">
					  </embed>
					</object>
				</div>
			{% endif %}
			<div id="institution_id">
				{% autopaginate institutions 12 %}
				{% for institution in institutions %}
					<div class="grid">
						<center>
							<div class="title_of_grid">
								<h6>{{institution.ins_name}}</h6>
							</div>
							<div class="grid_img">
								<a href="/institutions/{{institution.id}}"><img src="../../site_media/media/{{institution.ins_image}}"  width="180" height="150"/></a>
							</div>
							<p><a class="del_news" href="/institutions/{{institution.id}}">Дэлгэрэнгүй</a></p>
						</center>
					</div>
				{% endfor %}
				{% paginate %}
				<br/>
			</div>
			{% if banner_bottom %}
				<div id="">
		 			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
					  id="name" width="728" height="90">
					  <param name="movie" value="../../site_media/media/{{banner_bottom}}">
					  <param name="quality" value="high">
					  <param name="wmode" value="transparent">
					  <embed name="name" src="../../site_media/media/{{banner_bottom}}"
						  quality="high" wmode="transparent" width="728" height="90"
						  type="application/x-shockwave-flash" 
						  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
						  P1_Prod_Version=ShockwaveFlash">
					  </embed>
					</object>
				</div>
			{% endif %}
		{% endif %}
		
			
		{% if files %}
			{% autopaginate files 5 %}
		<table id="file_table">
			{% for file in files %}
				<tr>
					<td>
					<img src="../../site_media/media/{{file.file_image}}" style ="margin-bottom:10px;"width="120" height="160"/>
					</td>
					<td style="border:solid; border-width:20px; border-color:white; text-align: justify;">
						<a href="/files/{{file.id}}"><h3 id = "filess">{{file.file_name}}</h3></a>
						<p>Хэмжээ: {{file.file.size|filesizeformat}}</p>
						<br />
						<p>{{file.file_description|safe}}</p>
						<br />
						<a href="{% url download file.id%}">Файлыг татах</a>
					</td>					
				</tr>
			{% endfor %}
		</table>
			{% paginate %}
		{% endif %}
		
{% endblock %}



{% block banner %}
	{% if universities %}
		
	{% endif %}
	
{% endblock %}


